﻿using System;
using System.Collections.Generic;

using System.Web;

/// <summary>
///CutStr 的摘要说明
/// </summary>
public class CutStr
{
    public CutStr()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }
    public static string cut(object obj, int length)
    {
        string str = obj.ToString();
        byte[] len = System.Text.Encoding.Default.GetBytes(str);
        if (len.Length > length * 2)
        {
            str = str.Substring(0, length) + "...";
        }
        return str;
    }
}